package com.gdpu.liou.symphonyserver.service.impl;

import com.gdpu.liou.symphonyserver.mapper.RankMapper;

import com.gdpu.liou.symphonyserver.service.RankService;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RankServiceImpl implements RankService {
    private final RankMapper rankMapper;

    public RankServiceImpl(RankMapper rankMapper) {
        this.rankMapper = rankMapper;
    }


    @Override
    public boolean gradePlaylist(Long playlistId, Long consumerId, Integer score) {
        return rankMapper.gradePlaylist(playlistId, consumerId, score);
    }

    @Override
    public List<Map<String, String>> selectAvgScoreOfPlaylist() {
        return rankMapper.selectAvgScoreOfPlaylists();
    }

    @Override
    public Double selectGradeOfPlaylistOfConsumer(Long playlistId, Long consumerId) {
        return rankMapper.selectGradeOfPlaylistOfConsumer(playlistId, consumerId);
    }


}
